---
category: CSS
created: '2023-09-02'
description: The differences between font-size and line-height properties in CSS
openGraphCover: /og/this-vs-that/font-size-vs-line-height.png
title: font-size vs line-height
---

When you're styling text on a webpage, you've got some powerful tools at your disposal: `font-size` and `line-height`. Both of these CSS properties impact the way text looks on the page, but they do so in different ways.

Let's explore the differences between them in this post.

## Font-size

The `font-size` property controls how big or small the text on a page appears. You can set it to a specific number, like `16px`, or use relative sizes like `1.5em`. A bigger `font-size` will make the text look larger, while a smaller `font-size` will make it appear smaller.

It's important to note that the `font-size` you choose will affect the overall readability of your content. Text that is too small may be difficult to read, while text that is too large may be overwhelming. It's important to strike a balance between legibility and aesthetics.

## Line-height

The `line-height` property controls the amount of space between lines of text. You can specify it as a multiple of the font-size, like `1.5`, or as an absolute value, like `24px`. If you set a higher `line-height`, you'll get more space between the lines, and if you set a lower `line-height`, you'll get less space between them.

Choosing the right `line-height` is important for readability as well. If the lines of text are too close together, it can be difficult to distinguish where one line ends and the next begins. Conversely, if the lines are too far apart, it can be difficult to read the text as a cohesive whole.

## Impact of font size and line height on website accessibility

Font size and line height aren't just about looks. They're also crucial for making websites accessible to everyone, especially people with visual impairments like low vision or color blindness.

For instance, if you use a font that's too small, it can be tough for people with low vision to read. And if your line spacing is too tight, it can make things harder for people with dyslexia to tell one line of text from another.

So, when picking font sizes and line heights, it's important to think about your users' accessibility needs. You might need to bump up the font size and spacing a bit to make things easier to read without sacrificing style.

By designing your typography with accessibility in mind, you can make sure your website welcomes everyone, no matter their abilities.

## Using font-size and line-height properties together

When it comes to creating readable typography on your webpage, `font-size` and `line-height` are a dynamic duo. A good rule of thumb is to set the `line-height` to about 1.5 times the `font-size`. For example, if your `font-size` is `16px`, you might set your `line-height` to `24px`.

Keep in mind that different fonts may require different `line-height` values to achieve the same level of readability. Also, the type of content you present and the purpose of your website can affect the best `font-size` and `line-height` values.

By playing around with different `font-size` and `line-height` values, you can create typography that looks great and is easy to read.
